<template>
  <div>
    <el-dialog
      title="请选择时间段"
      :visible.sync="applyDialog"
      :append-to-body="true"
      style="width:50%;text-align:center;margin:0 auto"
    >
      <el-form-item prop="visitDate" label="拜访时间">
        <el-date-picker
          v-model="form.visitDate"
          unlink-panels
          type="datetimerange"
          style="width:220px"
          start-placeholde="开始时间"
          end-placeholde="结算时间"
          format="yyyy-MM-dd HH:mm:ss"
          value-format="yyyy-MM-dd HH:mm:ss"
        />
      </el-form-item>
      <el-form-item prop="crateDate" label="创建时间">
        <el-date-picker
          v-model="form.crateDate"
          unlink-panels
          type="datetimerange"
          style="width:220px"
          start-placeholde="开始时间"
          end-placeholde="结算时间"
          format="yyyy-MM-dd HH:mm:ss"
          value-format="yyyy-MM-dd HH:mm:ss"
        />
      </el-form-item>
      <div slot="footer">
        <el-button size="mini" @click="applyDialog = false">取消</el-button>
        <el-button size="mini" type="primary" @click="batchReview()"
          >确定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { ajax } from "@/store/yg/common/utils";
import * as constant from "@/store/yg/common/constant";

export default {
  props: ["row", "data", "more"],
  data() {
    return {
      applyDialog: false,
      form:{
      visitDate: [],
      crateDate:[]
      }
    };
  },
  mounted() {
    this.applyDialog = true;
  },
  methods: {
    async batchReview() {
      console.log(this.$store.state.edit)
      // const idss = this.$store.state.edit.ids;
      // console.log(idss)
      this.form.ids= this.$store.state.edit.ids;
      console.log(this.form)
      let res=await ajax("exportHopeInfo", this.form);
      if(res!=null && res.errorMesage!=null){
        this.$message.error(res.errorMesage);
      }else{
        var path = (path = constant.FILE_SERVER + res.path);
        location.href = constant.API_SERVER + "/open/downloadFileByHttp?fileName=&path=" + path;
        this.applyDialog = false;
      }
    }
  }
};
</script>
<style scoped></style>

<style lang="scss">
// .row-item {
//   color: #3f4652;
//   line-height: 28px;
//   margin-bottom: 14px;
// }
</style>
